﻿using System;
using System.ServiceModel;
using System.ServiceModel.Web;
using BizTalkFlow.Model;
using System.Xml;
using System.IO;
using System.Runtime.Serialization;

namespace BizTalkFlow.WcfService
{
    [ServiceContract]
    public interface IArtefactsLinksService
    {
        [OperationContract]
        [WebInvoke(Method = "GET",
        ResponseFormat = WebMessageFormat.Json,
        UriTemplate = "GetFrom/{StartDate}/To/{EndDate}/format=json")]
        ArtefactModel GetFromTo(string StartDate, string EndDate);

        [OperationContract]
        //[FaultContract(typeof(Fault), Action = Fault.Action)]
        [WebInvoke(Method = "GET",
        ResponseFormat = WebMessageFormat.Json,
        UriTemplate = "GetLast/{intervalType}/{numberOfIntervalInPast}/{includeFlowInstances}/format=json")]
        ArtefactModel GetLast(string numberOfIntervalInPast, string intervalType, string includeFlowInstances);

        [OperationContract]
        [WebInvoke(Method = "GET",
        ResponseFormat = WebMessageFormat.Json,
        UriTemplate = "GetByInstanceID/{instanceID}/format=json")]
        ArtefactModel GetByInstanceID(string instanceID);

        [OperationContract, XmlSerializerFormat]
        [WebInvoke(Method = "GET",
        ResponseFormat = WebMessageFormat.Xml,
        UriTemplate = "GetByInstanceID/{instanceID}/format=dgml")]
        XmlDocument GetDGMLByInstanceID(string instanceID);

        [OperationContract, XmlSerializerFormat]
        [WebInvoke(Method = "GET",
        ResponseFormat = WebMessageFormat.Xml,
        UriTemplate = "GetFrom/{StartDate}/To/{EndDate}/format=dgml")]
        XmlDocument GetDGMLFromTo(string StartDate, string EndDate);

        [OperationContract,XmlSerializerFormat]
        [WebInvoke(Method = "GET",
        ResponseFormat = WebMessageFormat.Xml,
        UriTemplate = "GetLast/{intervalType}/{numberOfIntervalInPast}/{createApplications}/{createFlows}/{includeFlowInstances}/format=dgml")]
        XmlDocument GetDGMLLast(string numberOfIntervalInPast, string intervalType, string createApplications, string createFlows, string includeFlowInstances);
     }

    //[DataContract(Namespace = "WcfFaultRouting")]
    //public class Fault
    //{
    //    public const string Action = "Error";
    //    [DataMember]
    //    public string Message
    //    {
    //        get;
    //        set;
    //    }
    //}


}
